package com.ruoyi.tzai.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 任务步骤对象 tzai_task_step
 * 
 * @author tzai
 * @date 2025-11-12
 */
public class TaskStep extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 步骤ID */
    private Long stepId;

    /** 任务ID */
    @Excel(name = "任务ID")
    private Long taskId;

    /** 步骤名称 */
    @Excel(name = "步骤名称")
    private String stepName;

    /** 步骤顺序 */
    @Excel(name = "步骤顺序")
    private Integer stepOrder;

    /** 状态 */
    @Excel(name = "状态", readConverterExp = "pending=待处理,running=运行中,completed=已完成,failed=失败,skipped=已跳过")
    private String status;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startedAt;

    /** 完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date completedAt;

    /** 耗时(秒) */
    @Excel(name = "耗时(秒)")
    private Integer duration;

    /** 进度(0-100) */
    @Excel(name = "进度")
    private Integer progress;

    /** 输入数据JSON */
    private String inputData;

    /** 输出数据JSON(包含断点信息) */
    private String outputData;

    /** 错误信息 */
    private String errorMessage;

    /** API调用详情JSON */
    private String apiCalls;

    public void setStepId(Long stepId) 
    {
        this.stepId = stepId;
    }

    public Long getStepId() 
    {
        return stepId;
    }

    public void setTaskId(Long taskId) 
    {
        this.taskId = taskId;
    }

    public Long getTaskId() 
    {
        return taskId;
    }

    public void setStepName(String stepName) 
    {
        this.stepName = stepName;
    }

    public String getStepName() 
    {
        return stepName;
    }

    public void setStepOrder(Integer stepOrder) 
    {
        this.stepOrder = stepOrder;
    }

    public Integer getStepOrder() 
    {
        return stepOrder;
    }

    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public void setStartedAt(Date startedAt) 
    {
        this.startedAt = startedAt;
    }

    public Date getStartedAt() 
    {
        return startedAt;
    }

    public void setCompletedAt(Date completedAt) 
    {
        this.completedAt = completedAt;
    }

    public Date getCompletedAt() 
    {
        return completedAt;
    }

    public void setDuration(Integer duration) 
    {
        this.duration = duration;
    }

    public Integer getDuration() 
    {
        return duration;
    }

    public void setProgress(Integer progress) 
    {
        this.progress = progress;
    }

    public Integer getProgress() 
    {
        return progress;
    }

    public void setInputData(String inputData) 
    {
        this.inputData = inputData;
    }

    public String getInputData() 
    {
        return inputData;
    }

    public void setOutputData(String outputData) 
    {
        this.outputData = outputData;
    }

    public String getOutputData() 
    {
        return outputData;
    }

    public void setErrorMessage(String errorMessage) 
    {
        this.errorMessage = errorMessage;
    }

    public String getErrorMessage() 
    {
        return errorMessage;
    }

    public void setApiCalls(String apiCalls) 
    {
        this.apiCalls = apiCalls;
    }

    public String getApiCalls() 
    {
        return apiCalls;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("stepId", getStepId())
            .append("taskId", getTaskId())
            .append("stepName", getStepName())
            .append("stepOrder", getStepOrder())
            .append("status", getStatus())
            .append("startedAt", getStartedAt())
            .append("completedAt", getCompletedAt())
            .append("duration", getDuration())
            .append("progress", getProgress())
            .append("inputData", getInputData())
            .append("outputData", getOutputData())
            .append("errorMessage", getErrorMessage())
            .append("apiCalls", getApiCalls())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}

